<nz-card>
  <div class="common-search-wrap">
    <div class="common-search-forms">
      <div class="common-form-item">
        <label class="common-search-label">综合搜索</label>
        <div class="common-search-conrol">
          <input nz-input placeholder="ID/交易流水" [(ngModel)]="searchParams.oddNumbers" />
        </div>
      </div>

      <div class="common-form-item">
        <label class="common-search-label">付款时间</label>
        <div class="common-search-conrol">
          <nz-range-picker [(ngModel)]="payDates" (ngModelChange)="dateChange($event)"></nz-range-picker>
        </div>
      </div>

      <div class="common-form-item">
        <div class="common-search-conrol">
          <button nz-button nzType="primary" class="m-r-8" [nzLoading]="tableParams.tableLoading" (click)="searchData()">查询</button>
          <button nz-button nzType="default" (click)="resetData()">重置</button>
        </div>
      </div>
    </div>
  </div>
</nz-card>

<nz-card class="m-t-2">
  <div class="operation-wrap p-b-15">
    <button nz-button nzType="primary" [nzLoading]="exportLoading" (click)="exportTable()">导出</button>
  </div>

  <div class="pagination-wrap-position table-wrap">
    <nz-table
      #basicTable
      nzSize="small"
      nzShowSizeChanger
      nzShowQuickJumper
      nzOuterBordered
      [nzFrontPagination]="false"
      [nzLoadingDelay]="100"
      [nzLoading]="tableParams.tableLoading"
      [nzData]="tableData"
      [nzPageSizeOptions]="[5, 10, 20, 50, 100]"
      [nzTotal]="tableParams.total"
      [nzPageIndex]="tableParams.page"
      [nzPageSize]="tableParams.pageSize"
      [nzShowTotal]="totalTemplate"
      (nzPageIndexChange)="onPageIndexChange($event)"
      (nzPageSizeChange)="onPageSizeChange($event)"
    >
      <thead>
        <tr>
          <th nzAlign="center" nzWidth="100px">ID</th>
          <th nzAlign="center">定制券</th>
          <th nzAlign="center">付款时间</th>
          <th nzAlign="center">付款爱豆</th>
          <th nzAlign="center">付款金额</th>
          <th nzAlign="center">交易流水</th>
        </tr>
      </thead>

      <tbody>
        <tr *ngFor="let data of basicTable.data; let index = index;">
          <td nzAlign="center">{{ data.id }}</td>
          <td nzAlign="center">{{ data.content || '-' }}</td>
          <td nzAlign="center">{{ data.createTime || '-' }}</td>
          <td nzAlign="center">{{ data.aiDouAmount || '0' }}</td>
          <td nzAlign="center">{{ data.realPrice || '0' }}</td>
          <td nzAlign="center">{{ data.payOrderNum || '-' }}</td>
        </tr>
      </tbody>
    </nz-table>

    <!-- 分页template -->
    <ng-template #totalTemplate let-total>共有 {{ tableParams.total }} 条</ng-template>
  </div>
</nz-card>